import { MockMethod } from "vite-plugin-mock"

export default [
  {
    url: "/dev-api/room",
    timeout: 2000,
    method: "get",
    // "id": 1, //初始值1开始，每条+1
    // "icons": 'slack',
    // "label": '成都区项目',
    response: () => {
      return {
        "code": 20000,
        "msg": "查询成功",
        "data": {
          "results": [
            {
              "zone": "小区1",
              "children": [
                {
                  "id": 1,
                  "create_time": "2024-09-16T13:37:45.167279+08:00",
                  "update_time": "2024-09-16T13:37:45.167279+08:00",
                  "zone": "小区1",
                  "layer": 1,
                  "no": 1
                },
                {
                  "id": 2,
                  "create_time": "2024-09-16T13:37:59.305815+08:00",
                  "update_time": "2024-09-16T13:37:59.305815+08:00",
                  "zone": "小区1",
                  "layer": 1,
                  "no": 2
                },
                {
                  "id": 3,
                  "create_time": "2024-09-16T13:38:16.241606+08:00",
                  "update_time": "2024-09-16T13:38:16.241606+08:00",
                  "zone": "小区1",
                  "layer": 2,
                  "no": 1
                },
                {
                  "id": 4,
                  "create_time": "2024-09-16T13:38:24.307098+08:00",
                  "update_time": "2024-09-16T13:38:24.307098+08:00",
                  "zone": "小区1",
                  "layer": 2,
                  "no": 2
                }
              ]
            },
            {
              "zone": "小区2",
              "children": [
                {
                  "id": 5,
                  "create_time": "2024-09-16T13:38:34.575506+08:00",
                  "update_time": "2024-09-16T13:38:34.575506+08:00",
                  "zone": "小区2",
                  "layer": 1,
                  "no": 1
                },
                {
                  "id": 6,
                  "create_time": "2024-09-16T13:38:41.322288+08:00",
                  "update_time": "2024-09-16T13:38:41.322288+08:00",
                  "zone": "小区2",
                  "layer": 1,
                  "no": 2
                }
              ]
            },
            {
              "zone": "小区3",
              "children": []
            }
          ]
        }
      }
    }
  },
  {
    url: "/dev-api/energyWatch/power/search",
    timeout: 2000,
    method: "post",
    response: () => {
      return {
        "code": 20000,
        "msg": "查询成功",
        "data": {
          "total": "@integer(10, 50)", // 总记录数
          "records|10": [{ //生成20条数据
            "id|+1": 1, //初始值1开始，每条+1
            "roleName|1": ['超级管理员', '售前客服', '售后客服'],
            "roleCode": "ROLE_" + "@word(5)", // ROLE_5个英文字符
            'status|10-2': true, // Boolean, 生成 true 概率 10/(10+2), false 概率 2/(10+2)
            "remark": "@ctitle",
            "createTime": "@date", // 随机创建时间
            "updateTime": "@date", // 随机更新时间
          }]
        }
      }
    }
  },
] as MockMethod[]